package com.xianniu.ltc.enums;

import lombok.Getter;

/**
 * @author wangruijie
 * @version 1.0
 * @description: < 订单类型 >
 * @date 2021/5/27 19:32
 */
@Getter
public enum PurchaseOrderTypeEnum {
    // 订单类型(1维保服务，2技术支持，3产品采购，4，驻场服务)
    WB(1,"019-0179a89d0b100294"),
    JS(2,"019-0179a89cf5920293"),
    CP(3,"019-0179c6206e850025"),
    ZC(4,"019-017aecc143d20020");

    private Integer key;
    private String value;

    PurchaseOrderTypeEnum(Integer key, String value){
        this.key=key;
        this.value=value;
    }
    /**
     * 自己定义一个静态方法,通过key返回枚举常量对象
     * @param key
     * @return
     */
    public static PurchaseOrderTypeEnum getValue(Integer key){

        for (PurchaseOrderTypeEnum color: values()) {
            if(color.getKey().equals(key)){
                return  color;
            }
        }
        return null;
    }
}
